import app from './app.js';
import CustomerServiceWebSocket from './websocket/customerService.js';

const PORT = process.env.PORT || 5000;

const server = app.listen(PORT, () => {
  console.log(`服务器运行在端口 ${PORT}`);
}).on('error', (err) => {
  console.error('服务器启动失败:', err);
});

// 初始化WebSocket服务
const customerServiceWS = new CustomerServiceWebSocket(server);
console.log('客服WebSocket服务已启动');